# Set the base image to Ubuntu
FROM centos:7

# File Author / Maintainer
MAINTAINER docker

#Install basic application
RUN yum install -y git curl python python-devel python-pip crontabs epel-release mysql-devel httpd mod_wsgi

#RUN cd /usr/local/share

#download source
RUN git clone https://gitee.com/openteamone/register.git  /usr/local/share

RUN cd /usr/local/share/register


#install project package
RUN pip install -r requirements.txt


#init database
RUN python manage.py makemigrations register
RUN python manage.py migrate

#static files
RUN python manage.py collectstatic

RUN python manage.py loaddata fixtures/RecordTime.json
RUN python manage.py crontab add

#add http configration file
ADD conf/register.conf /etc/httpd/conf.d/

#start httpd
RUN httpd


EXPOSE 81
